Integrand size = 21, antiderivative size = 148 \[ \int \frac {\cos ^3(c+d x)}{a+b \sec (c+d x)} \, dx=-\frac {b \left (a^2+2 b^2\right ) x}{2 a^4}+\frac {2 b^4 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^4 \sqrt {a-b} \sqrt {a+b} d}+\frac {\left (2 a^2+3 b^2\right ) \sin (c+d x)}{3 a^3 d}-\frac {b \cos (c+d x) \sin (c+d x)}{2 a^2 d}+\frac {\cos ^2(c+d x) \sin (c+d x)}{3 a d} \]
[Out]
Time = 0.52 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {3938, 4189, 4004, 3916, 2738, 214} \[ \int \frac {\cos ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {2 b^4 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^4 d \sqrt {a-b} \sqrt {a+b}}-\frac {b \sin (c+d x) \cos (c+d x)}{2 a^2 d}-\frac {b x \left (a^2+2 b^2\right )}{2 a^4}+\frac {\left (2 a^2+3 b^2\right ) \sin (c+d x)}{3 a^3 d}+\frac {\sin (c+d x) \cos ^2(c+d x)}{3 a d} \]
[In]
[Out]
Rule 214
Rule 2738
Rule 3916
Rule 3938
Rule 4004
Rule 4189
Rubi steps \begin{align*} \text {integral}& = \frac {\cos ^2(c+d x) \sin (c+d x)}{3 a d}+\frac {\int \frac {\cos ^2(c+d x) \left (-3 b+2 a \sec (c+d x)+2 b \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{3 a} \\ & = -\frac {b \cos (c+d x) \sin (c+d x)}{2 a^2 d}+\frac {\cos ^2(c+d x) \sin (c+d x)}{3 a d}-\frac {\int \frac {\cos (c+d x) \left (-2 \left (2 a^2+3 b^2\right )-a b \sec (c+d x)+3 b^2 \sec ^2(c+d x)\right )}{a+b \sec (c+d x)} \, dx}{6 a^2} \\ & = \frac {\left (2 a^2+3 b^2\right ) \sin (c+d x)}{3 a^3 d}-\frac {b \cos (c+d x) \sin (c+d x)}{2 a^2 d}+\frac {\cos ^2(c+d x) \sin (c+d x)}{3 a d}+\frac {\int \frac {-3 b \left (a^2+2 b^2\right )-3 a b^2 \sec (c+d x)}{a+b \sec (c+d x)} \, dx}{6 a^3} \\ & = -\frac {b \left (a^2+2 b^2\right ) x}{2 a^4}+\frac {\left (2 a^2+3 b^2\right ) \sin (c+d x)}{3 a^3 d}-\frac {b \cos (c+d x) \sin (c+d x)}{2 a^2 d}+\frac {\cos ^2(c+d x) \sin (c+d x)}{3 a d}+\frac {b^4 \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{a^4} \\ & = -\frac {b \left (a^2+2 b^2\right ) x}{2 a^4}+\frac {\left (2 a^2+3 b^2\right ) \sin (c+d x)}{3 a^3 d}-\frac {b \cos (c+d x) \sin (c+d x)}{2 a^2 d}+\frac {\cos ^2(c+d x) \sin (c+d x)}{3 a d}+\frac {b^3 \int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{a^4} \\ & = -\frac {b \left (a^2+2 b^2\right ) x}{2 a^4}+\frac {\left (2 a^2+3 b^2\right ) \sin (c+d x)}{3 a^3 d}-\frac {b \cos (c+d x) \sin (c+d x)}{2 a^2 d}+\frac {\cos ^2(c+d x) \sin (c+d x)}{3 a d}+\frac {\left (2 b^3\right ) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^4 d} \\ & = -\frac {b \left (a^2+2 b^2\right ) x}{2 a^4}+\frac {2 b^4 \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^4 \sqrt {a-b} \sqrt {a+b} d}+\frac {\left (2 a^2+3 b^2\right ) \sin (c+d x)}{3 a^3 d}-\frac {b \cos (c+d x) \sin (c+d x)}{2 a^2 d}+\frac {\cos ^2(c+d x) \sin (c+d x)}{3 a d} \\ \end{align*}
Time = 0.40 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.82 \[ \int \frac {\cos ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {-6 b \left (a^2+2 b^2\right ) (c+d x)-\frac {24 b^4 \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+3 a \left (3 a^2+4 b^2\right ) \sin (c+d x)-3 a^2 b \sin (2 (c+d x))+a^3 \sin (3 (c+d x))}{12 a^4 d} \]
[In]
[Out]
Time = 0.71 (sec) , antiderivative size = 179, normalized size of antiderivative = 1.21
method | result | size |
derivativedivides | \(\frac {\frac {2 b^{4} \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{4} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {2 \left (\frac {\left (-a^{3}-\frac {1}{2} a^{2} b -a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+\left (-\frac {2}{3} a^{3}-2 a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (-a^{3}-a \,b^{2}+\frac {1}{2} a^{2} b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}+\frac {b \left (a^{2}+2 b^{2}\right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}\right )}{a^{4}}}{d}\) | \(179\) |
default | \(\frac {\frac {2 b^{4} \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{4} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {2 \left (\frac {\left (-a^{3}-\frac {1}{2} a^{2} b -a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}+\left (-\frac {2}{3} a^{3}-2 a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}+\left (-a^{3}-a \,b^{2}+\frac {1}{2} a^{2} b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}+\frac {b \left (a^{2}+2 b^{2}\right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}\right )}{a^{4}}}{d}\) | \(179\) |
risch | \(-\frac {b x}{2 a^{2}}-\frac {b^{3} x}{a^{4}}-\frac {3 i {\mathrm e}^{i \left (d x +c \right )}}{8 d a}-\frac {i {\mathrm e}^{i \left (d x +c \right )} b^{2}}{2 a^{3} d}+\frac {3 i {\mathrm e}^{-i \left (d x +c \right )}}{8 d a}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} b^{2}}{2 a^{3} d}+\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, d \,a^{4}}-\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, d \,a^{4}}+\frac {\sin \left (3 d x +3 c \right )}{12 d a}-\frac {b \sin \left (2 d x +2 c \right )}{4 a^{2} d}\) | \(280\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 401, normalized size of antiderivative = 2.71 \[ \int \frac {\cos ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\left [\frac {3 \, \sqrt {a^{2} - b^{2}} b^{4} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) - 3 \, {\left (a^{4} b + a^{2} b^{3} - 2 \, b^{5}\right )} d x + {\left (4 \, a^{5} + 2 \, a^{3} b^{2} - 6 \, a b^{4} + 2 \, {\left (a^{5} - a^{3} b^{2}\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (a^{4} b - a^{2} b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{6} - a^{4} b^{2}\right )} d}, \frac {6 \, \sqrt {-a^{2} + b^{2}} b^{4} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) - 3 \, {\left (a^{4} b + a^{2} b^{3} - 2 \, b^{5}\right )} d x + {\left (4 \, a^{5} + 2 \, a^{3} b^{2} - 6 \, a b^{4} + 2 \, {\left (a^{5} - a^{3} b^{2}\right )} \cos \left (d x + c\right )^{2} - 3 \, {\left (a^{4} b - a^{2} b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, {\left (a^{6} - a^{4} b^{2}\right )} d}\right ] \]
[In]
[Out]
Timed out. \[ \int \frac {\cos ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {\cos ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 249, normalized size of antiderivative = 1.68 \[ \int \frac {\cos ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\frac {12 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} b^{4}}{\sqrt {-a^{2} + b^{2}} a^{4}} - \frac {3 \, {\left (a^{2} b + 2 \, b^{3}\right )} {\left (d x + c\right )}}{a^{4}} + \frac {2 \, {\left (6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3} a^{3}}}{6 \, d} \]
[In]
[Out]
Time = 14.67 (sec) , antiderivative size = 654, normalized size of antiderivative = 4.42 \[ \int \frac {\cos ^3(c+d x)}{a+b \sec (c+d x)} \, dx=\frac {\frac {b^2\,\sin \left (c+d\,x\right )}{4}-\frac {b^2\,\sin \left (3\,c+3\,d\,x\right )}{12}}{a\,d\,\left (a^2-b^2\right )}-\frac {b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {b\,\sin \left (2\,c+2\,d\,x\right )}{4}}{d\,\left (a^2-b^2\right )}+\frac {a\,\left (\frac {3\,\sin \left (c+d\,x\right )}{4}+\frac {\sin \left (3\,c+3\,d\,x\right )}{12}\right )}{d\,\left (a^2-b^2\right )}-\frac {b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )-\frac {b^3\,\sin \left (2\,c+2\,d\,x\right )}{4}}{a^2\,d\,\left (a^2-b^2\right )}-\frac {b^4\,\sin \left (c+d\,x\right )}{a^3\,d\,\left (a^2-b^2\right )}+\frac {2\,b^5\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{a^4\,d\,\left (a^2-b^2\right )}+\frac {b^4\,\mathrm {atan}\left (\frac {\left (8\,b^7\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a^2-b^2\right )}^{3/2}-a^9\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}+8\,b^9\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}-8\,a^2\,b^7\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}-3\,a^4\,b^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}+3\,a^5\,b^4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}+2\,a^6\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}-2\,a^7\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}+a^8\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2-b^2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (a\,b^2-a^3\right )\,\left (4\,b^5\,\left (a^2-b^2\right )+2\,a\,b^6-a^7+4\,b^7-2\,a^2\,b^5+a^3\,b^4-2\,a^4\,b^3-2\,a^5\,b^2+2\,a^2\,b^3\,\left (a^2-b^2\right )+2\,a\,b^4\,\left (a^2-b^2\right )\right )}\right )\,2{}\mathrm {i}}{a^4\,d\,\sqrt {a^2-b^2}} \]
[In]
[Out]